import http from '../utils/http'

export const userReg = (data)=>{ //注册
  return http.post('/user/reg',data)
}

export const userLogin = (data)=>{ //登录
  return http.post('/user/login',data)
}

export const userAuth = ()=>{
  let uInfo = localStorage.getItem('userInfo') || `{}`
  let {token} = JSON.parse(uInfo)
  return http.get(`/auth?token=${token}`)
}